<template>
	<!---本页面需要用到滑动删除组件 -->

		<view class="uni-mask" v-show="showShare"  :style="{top:offsetTop + 'px'}" @click="hide">
				<view :class="['uni-popup','uni-popup-middle']" >
							<view class="share-context"><text>你确定要分享吗?</text></view>
							<view class="share-botton-view">
									<view class="share-botton-box">
											<button class="button-cancel" type="" @click="goToBar('/pages/myBill/index')">取消</button>
											<button class="button-primary" open-type="share"  >确定</button>
									</view>
						</view>
					

				</view>
	
	  <canvas canvas-id="myCanvas" :style="{width:shareData.windowWidth+'px',height:shareData.windowHeight+'px'}" id="myCanvas"/>
	</view>
	
</template>

<script>
	import shareCanvas from '@/common/shareCanvas.js';
	export default {
		
		props:{
			showShare:{
				type:Boolean,
				default: false
			},
			shareData:{
				type:Object
			},
			shareBaseData:{
				type:Object
			}
			
			
		},
		data() {
			return {
						searchValue: '',
						loadingType: 0,
						showImage: false,
						results: [],
						grIds: [], //订单数组
						contentText: {
								contentdown: "",
								contentrefresh: "正在加载...",
								contentnomore: "没有更多数据了"
						},
						resData: {      //返回数据结构
								pageNum:  1,   //页数
								total: 0,      //总多少条
								list: []       //数据列表
						},
					}
						
		},


		methods: {
			//初始化数据 由父组件触发
			initShareData(){
				console.log('初始化子组件');
				console.log('this.shareData====',this.shareData);
				this.getSysinfo();
				var obj = shareCanvas.preHandlePic(this.shareData);
				setTimeout(function(){
					shareCanvas.getSharePic(obj);
				},1500)
			},
			getSysinfo:function(){
				var that = this;
				uni.getSystemInfo({
					success: function (res) {
						that.shareData.windowWidth= res.windowWidth
						that.shareData.windowHeight= 696,
						that.shareData.pixelRatio = 750/res.windowWidth 
					}
				});					
			},

			
		}
	}
</script>

<style  >
@font-face {
	font-family: uniicons;
	font-weight: normal;
	font-style: normal;
	src: url('https://img-cdn-qiniu.dcloud.net.cn/fonts/uni.ttf') format('truetype');
}
view{
	font-size:28upx; 
	line-height:1.8;
}

	.uni-mask {
		position: fixed;
		z-index: 998;
		top: 0;
		right: 0;
		bottom: 0;
		left: 0;
		background-color: rgba(0, 0, 0, .3);
	}

	.uni-popup {
		position: absolute;
		z-index: 999;
		background-color: #ffffff;
		box-shadow: 0 0 30upx rgba(0, 0, 0, .1);
	}

	.uni-popup-middle {
		display: flex;
		flex-direction: column;
		align-items: center;
		width: 380upx;
		height: 280upx;
		border-radius: 10upx;
		top: 50%;
		left: 50%;
		transform: translate(-50%, -50%);
		justify-content: center;
		padding: 30upx;

	}
	.share-context{
		font-size: 34upx;
		
	}		
.share-botton-view{
	position: fixed; 
	bottom: 0;
	width: 100%;

}




.uni-inline-item{
	display: flex;
	flex-direction: row;
	align-items:center;
}
.uni-inline-item text{
	margin-right: 20upx;
}
.uni-inline-item text:last-child{
	margin-right: 0upx;
	margin-left: 20upx;
}

.share-botton-box{
	display: flex;
	justify-content: center;
	align-items: center;
	flex: 1;
	width: 100%;
	height: 60upx;
	bottom: 0;

}

.share-botton-box .button-primary{
	padding: 0;
	font-size: 34upx;
	letter-spacing: 1.5px;
	color: #FFFFFF;
	background: #1383f2;
	width: 50%;
	height: 88upx;
	border-radius: 0px;

}

 .share-botton-box .button-cancel{
	padding: 0;
	font-size: 34upx;
	letter-spacing: 1.5px;
	color: #1a1a1a;
	background: #FFFFFF;
	width: 50%;
	height: 88upx;
	border-radius: 0px;
}






</style>
